package com.chb.storm.trident;

import java.util.Map;

import storm.trident.state.State;
import storm.trident.state.StateFactory;
import backtype.storm.task.IMetricsContext;

public class AdHBaseStateFactory implements StateFactory {

	private AdHBaseState.Options options;
	
	public AdHBaseStateFactory(AdHBaseState.Options options) {
		this.options = options;
	}

	@Override
	public State makeState(Map map, IMetricsContext metrics, int partitionIndex, int numPartitions) {
		AdHBaseState state = new AdHBaseState(map, partitionIndex, numPartitions, options);
		state.prepare();
		return state;
	}

}
